package com.zym.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zym.Valid.AddGroup;
import com.zym.Valid.UpdateGroup;
import lombok.AllArgsConstructor;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("emp")

public class Emp implements Serializable {
    @ExcelProperty(value = "员工编号")
    @NotNull(message = "员工编号不能为空")
    private Integer empno;

    @NotBlank(message = "员工名称不能为空")
    @ExcelProperty(value = "员工名称")
    private String ename;

    @NotBlank(message = "工作不能为空")
    @ExcelProperty(value = "工作")
    private String job;

    @NotNull(message = "主管编号不能为空")
    @ExcelProperty(value = "主管编号")
    @Min(value = 5,message = "最小不能小于5")
    private Integer mgr;

    @NotNull(message = "入职日期不能为空")
    @ExcelProperty(value = "入职日期")
    private Date hiredate;

    @NotNull(message = "薪资不能为空")
    @ExcelProperty(value = "薪资")
    private BigDecimal sal;

    @ExcelProperty(value = "奖金")
    private BigDecimal comm;

    @Pattern(regexp = "^[1][3,4,5,7,8][0-9]{9}$", message = "所属部门错误")
    @NotBlank(message = "所属部门不能为空")
    @ExcelProperty(value = "所属部门")
    private Integer deptno;

}
